package com.leetcode.www;

/**
 * Creared with IntelliJ IDEA.
 * Description:积木画,I型(2格)和L型(3格),摆放在2*n的画布中,积木方向可以随意旋转,但画布方向不变,统计有多少种方法摆放
 * User:yxd
 * Date:2022-04-11
 * Time:13:10
 */


import java.util.Scanner;

public class DpG {
    public static void main2(String[] args) {
        Scanner inpScanner = new Scanner(System.in);
        int n = inpScanner.nextInt();
        //状态定义F(i)表示2*n的画布放积木有多少中方法
        //状态转移方程F(i) = F(i - 1) * 2 + F(i - 3)
        //状态定义F(0) = 1 F(1) = 1  F(2) = 2
        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        dp[2] = 2;
        for(int i = 3;i <= n;i ++) {
            dp[i] = (dp[i - 1] * 2 + dp[i - 3]) % 1000000007;
        }
        System.out.println(dp[n]);
    }
    public static void main(String[] args) {
        Scanner inpScanner = new Scanner(System.in);
        int n = inpScanner.nextInt();
        long[] a = new long[n + 1];
        a[1] = 1l;
        a[2] = 2l;
        long sum = a[1] + a[2];
        for(int i = 3;i <= n;i ++) {
            a[i] = (2 * sum - a[i - 1] - a[i - 2] + 2) % 1000000007;
            sum += a[i];

        }
        System.out.println(a[n]);
    }

}
